# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/29 下午5:43
 @Author  : tgy
 
"""
import io
import urllib.request
import sys

def test01():
    ...
    f = open('5.4 读写字节数据.py', mode='r')
    print(f)
    print(f.buffer)
    print(f.buffer.raw)
    # f = io.TextIOWrapper(f.buffer,encoding='utf-8')
    print(f.read())


def test02():
    ...
    u = urllib.request.urlopen('http://www.baidu.com')

    print(u.read())

    f = io.TextIOWrapper(u, encoding='utf-8')
    # print(f.read())



if __name__ == '__main__':
    ...
    # test01()
    sys.stdout.buffer.write(b'asd')